import request from "@/uitls/request";
import { SkuResponseData } from "./type";
enum API {
  LIST_URL = "/admin/product/list/",
  DELETE_URL = "/admin/product/deleteSku/",
  //上架
  SALE_URL = "/admin/product/onSale/",
  //下架的接口
  CANCELSALE_URL = "/admin/product/cancelSale/",
}

// 获取商品sku列表
export const reqSkulist = (page: number, limt: number) =>
  request.get<any, SkuResponseData>(API.LIST_URL + `${page}/${limt}`);
export const reqRemoveSku = (skuId: number | string) =>
  request.get<any, any>(API.DELETE_URL + skuId);
//已有商品上架的请求
export const reqSaleSku = (skuId: number) =>
  request.get<any, any>(API.SALE_URL + skuId);
//下架的请求
export const reqCancelSale = (skuId: number) =>
  request.get<any, any>(API.CANCELSALE_URL + skuId);
